Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Port LinePaginator from all bots. #189

Merged
merged 5 commits into from
Jan 30, 2024
Merged

Port LinePaginator from all bots. #189

merged 5 commits into from
Jan 30, 2024

Conversation

shtlrs
Copy link
Member

@shtlrs shtlrs commented Jul 13, 2023

This is another step towards having one single reusable core component to our bots instead of duplicate definitions all across them.

Problem

Amongst others, LinePaginator is a class used by all of our bots, so bot-core should be its home.

The class has 2 main dependencies

  • The reaction check util
  • The pagination emojis.

Solution

Port it over to bot-core, and have all other bots import & use it.

The message.reaction_check util has been ported to bot-core

The main problem for now remains with the usage of constants. To tacke this, the idea is to make a wrapper over this LinePaginator in all clients that will inject the emojis instead of having to do it each time the paginator is needed.

@netlify
Copy link

netlify bot commented Jul 13, 2023

Deploy Preview for bot-core ready!

Name Link
🔨 Latest commit aa021ea
🔍 Latest deploy log https://app.netlify.com/sites/bot-core/deploys/65981a716aec6300087b5ca8
😎 Deploy Preview https://deploy-preview-189--bot-core.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@shtlrs shtlrs changed the title Use the same LinePaginator across all of our bots. Port LinePaginator from all bots. Jul 14, 2023
@shtlrs shtlrs marked this pull request as ready for review July 19, 2023 10:50
This is because it's a component that can be reused by all bots.
Copy link
Member

@ChrisLovering ChrisLovering left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Preview doesn't seem to be updating correctly, could you include some screenshots of what the docs look like for these new classes/features?

I can also build an alpha/beta version for this if it would be useful to test with on a bot.

docs/changelog.rst Outdated Show resolved Hide resolved
docs/changelog.rst Outdated Show resolved Hide resolved
pydis_core/utils/__init__.py Outdated Show resolved Hide resolved
@shtlrs
Copy link
Member Author

shtlrs commented Jan 4, 2024

Preview doesn't seem to be updating correctly, could you include some screenshots of what the docs look like for these new classes/features?

image

But I realized that I have only documented the class, not the methods themselves so I'll do that.

I can also build an alpha/beta version for this if it would be useful to test with on a bot.

Yes that would be great, thanks.

@shtlrs shtlrs force-pushed the botcore-settings branch 2 times, most recently from 8d950e8 to 43b720a Compare January 4, 2024 15:55
Copy link
Contributor

@wookie184 wookie184 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested via bot PR, LGTM

@Xithrius
Copy link
Member

Oops, didn't mean to re-request your review wookie. Apologies.

@ChrisLovering ChrisLovering merged commit aa021ea into main Jan 30, 2024
8 checks passed
@ChrisLovering ChrisLovering deleted the botcore-settings branch January 30, 2024 19:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants